<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="java.util.Calendar"%>
<%
	String title = "信息综合系统";
%>
<%@ include file="/WEB-INF/jsp/header.jsp"%>
<title><%=title%>-季度任务总表管理</title>
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="apple-itunes-app" content="app-id=429849944" />
<meta name="apple-touch-fullscreen" content="no" />
<meta content="telephone=no" name="format-detection" />
<meta name="apple-mobile-web-app-capable" content="no" />
</head>

<!-- BEGIN BODY -->
<body class="fixed-top" style="background: #fff;">

	<!-- BEGIN PAGE CONTAINER-->
	<div class="container-fluid">
		<!-- BEGIN PAGE HEADER-->
		<div class="row-fluid">
			<div class="span12">
				<ul class="breadcrumb"
					style="padding-bottom: 12px; background: #fff;"">
					<li><a href="${pageContext.request.contextPath}/user/index.do">
							<i class="icon-angle-left"></i> <i class="icon-angle-left"></i>
							&nbsp;&nbsp; 首页控制台
					</a> <span class="divider">/</span></li>

					<li class="active">季度任务总表管理</li>
					<li class="pull-right search-wrap">
					<form method="post" id="filterForm">
					   <c:if test="${user.age<1}">
					        <input type="hidden" value="${user.user_name}" name="mgr"/>
					   </c:if>
					</form>
					<input type="button" id="seach" name="seach" value="查询"
							class="btn  btn-primary" style="margin-bottom: 10px;"
							onclick="query(pNumber,pSize);"> 
							
						<input type="reset"
							id="reset" name="reset" value="重置该页面" class="btn  btn-primary"
							style="margin-bottom: 10px;" onclick="resetf();" />
							
							&nbsp;
						<div class="btn-group pull-right">
							<button class="btn dropdown-toggle" data-toggle="dropdown">
								更多 <i class="icon-angle-down"></i>
							</button>
							<ul class="dropdown-menu pull-right">
							</ul>
						</div>
					</li>
				</ul>
				<!-- END PAGE TITLE & BREADCRUMB-->
			</div>
		</div>
		<!-- END PAGE HEADER-->
		<!-- BEGIN BASIC PORTLET-->
		<div class="widget">
			<div class="row-fluid">
				<div class="span12">
					<!-- BEGIN ALERTS PORTLET-->
					<div class="widget blue">
						<div class="widget-title">
							<h4>
								<i class="icon-reorder"></i>季度任务总表
							</h4>
							<span class="tools"> <a href="javascript:;"
								class="icon-chevron-down"></a>
							</span>
						</div>

						<div class="widget-body" style="overflow: auto">
							<div class="pageBottom" style="text-align: center;">
								<input type="hidden" id="page-size" value="0" />
								<div id="callBackPager" class="paging_bootstrap pagination"></div>
							</div>
							<table class="table table-striped table-hover table-bordered"
								width="2640px;" style="table-layout: fixed">
								<thead>
									<tr>
										<th width="40px">省份</th>
										<th width="70px">地市</th>
										<th width="100px">区县</th>
										<th width="120px">片区经理</th>
										<th width="70px">客户</th>
										<th width="70px">客户级别</th>
										<th width="60px">产品</th>
										<th width="40px">重点终端数量</th>
										<th width="40px">重点区县数量</th>
										<th width="60px">Y19M1纯销目标</th>
										<th width="60px">Y19M2纯销目标</th>
										<th width="45px">Y19M3纯销目标</th>
										<th width="45px">预算推广费</th>
									</tr>
								</thead>
								<tbody id="distribute-body">
									<input type="hidden" id="selectIds" value="${ids }" />
								</tbody>

								<tbody id="distribute-body">
								</tbody>
							</table>
						</div>

					</div>
					<!-- END ALERTS PORTLET-->
				</div>
			</div>

		</div>
		<!-- END BASIC PORTLET-->
	</div>
	<script src="${pageContext.request.contextPath}/js/jquery-1.7.1.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/js/jquery.nicescroll.js"
		type="text/javascript"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/js/jquery-ui-1.9.2.custom.min.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/js/jquery.slimscroll.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/fullcalendar.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/js/jquery.easy-pie-chart.js"
		type="text/javascript"></script>
	<script src="${pageContext.request.contextPath}/js/jquery.sparkline.js"
		type="text/javascript"></script>
	<script src="${pageContext.request.contextPath}/js/Chart.js"></script>
	<script
		src="${pageContext.request.contextPath}/js/jquery.scrollTo.min.js"></script>
	<!--common script for all pages-->
	<script src="${pageContext.request.contextPath}/js/common-scripts.js"></script>

	<script type="text/javascript"
		src="${pageContext.request.contextPath}/js/layer/layer.js"></script>
	<%--<script src = "${pageContext.request.contextPath}/js/jquery.min.js" > </script>--%>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/js/bootstrap-multiselect.js"></script>
	<link rel="stylesheet"
		href="${pageContext.request.contextPath}/css/bootstrap-multiselect.css"
		type="text/css" />

	<script
		src="${pageContext.request.contextPath}/js/bootstrap-typeahead.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/js/extendPagination.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/js/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript"
		src="http://img3.job1001.com/js/ZeroClipboard/jquery.zclip.min.js"></script>

	<!-- END JAVASCRIPTS -->
	<!-- 自定义的script方法 -->
	<script type="text/javascript">
		$(document).ready(function() {
			$("#show").click(function() {
				$(".clearfix").slideToggle();
			});
			/*通过ID查询*/
			/* $('#province').multiselect({includeSelectAllOption:true,nonSelectedText: '请选择省份', enableFiltering: true, maxHeight: 300, buttonWidth: '100px'});
			 $('#city').multiselect({includeSelectAllOption:true,nonSelectedText: '请选择地市', enableFiltering: true, maxHeight: 300, buttonWidth: '100px'});
			 $('#product').multiselect({includeSelectAllOption:true,nonSelectedText: '请选择品种', enableFiltering: true, maxHeight: 300, buttonWidth: '100px'});
			 $('#pack').multiselect({includeSelectAllOption:true,nonSelectedText: '请选择包装',enableFiltering: true, maxHeight: 300,buttonWidth: '100px'});
			 */});
		/* var terminal = ${condiMap.terminal};
		 $('#terminal').typeahead({source: terminal})*/
		if (window.clipboardData) {
			$('#getProp').click(function() {
				var ids = getProp();
				if (selectedIds.trim().length > 0) {
					ids = selectedIds;
				}
				if (ids.trim().length > 0) {
					window.clipboardData.setData("Text", ids);
					layer.msg("复制成功！");
					$("#allAndNotAll").attr("checked", false);
					$("input[name='choice']:checkbox").each(function() {
						$(this).attr("checked", false);
					});
					layer.msg("复制成功！");
				} else {
					layer.alert("您没有选中行！");
				}
			});
		} else {
			$("#getProp")
					.zclip(
							{
								path : 'http://img3.job1001.com/js/ZeroClipboard/ZeroClipboard.swf',
								copy : function() {
									var ids = getProp();
									if (selectedIds.trim().length > 0) {
										ids = selectedIds;
									}
									if (ids.trim().length > 0) {
										return ids;
									} else {
										layer.msg("您没有选中行！");
									}
								},
								afterCopy : function() {
									layer.msg("复制成功！");
									$("#allAndNotAll").attr("checked", false);
									$("input[name='choice']:checkbox").each(
											function() {
												$(this).attr("checked", false);
											});
									layer.msg("复制成功！");
								}
							});
		}
	</script>

	<script type="text/javascript">
		function query(pageNumber, pageSize) {
			//查询后，隐藏查询区域
			//toggleCondi_hidden();
			var url = "${pageContext.request.contextPath }/task/selectTotal.do?pageNumber="
					+ pageNumber + "&pageSize=" + pageSize;
			var params = $("#filterForm").serialize();
			queryList(url, params);
		}

		//动态创建table
		function createTable(currPage, limit, total, items) {
			var html = [], showNum = limit;
			if (total - (currPage * limit) < 0)
				showNum = total - ((currPage - 1) * limit);
			for (var i = 0; i < showNum; i++) {
				html.push('<tr>');
				html.push('<td>' + formatData(items[i].province) + '</td>');
				html.push('<td>' + formatData(items[i].city) + '</td>');
				html.push('<td>' + formatData(items[i].country) + '</td>');

				html.push('<td>' + formatData(items[i].mgr) + '</td>');
				html.push('<td>' + formatData(items[i].client) + '</td>');
				html.push('<td>' + formatData(items[i].clientLevel) + '</td>');

				html.push('<td>' + formatData(items[i].product) + '</td>');
				html
						.push('<td>' + formatData(items[i].terminalCount)
								+ '</td>');
				html.push('<td>' + formatData(items[i].countryCount) + '</td>');

				html.push('<td>' + formatData(items[i].taskM1) + '</td>');
				html.push('<td>' + formatData(items[i].taskM2) + '</td>');
				html.push('<td>' + formatData(items[i].taskM3) + '</td>');

				html.push('<td>' + formatData(items[i].promotePrice) + '</td>');
				html.push('</tr>');
			}
			var mainObj = $('#distribute-body');
			mainObj.empty();
			mainObj.html(html.join(''));
		};
	</script>
	<!-- END BODY -->
	<script>
		var htmls = $("#updatePlanLogForm").html();
		var uploadFileHtml = $("#uploadFileForm").html();
		var ret = null;
		//所有选中的id
		var selectedIds = "";
		/* //全选或全不选
		$("#allAndNotAll").click(function() { 
		    if (this.checked){  
		        $("input[name='choice']:checkbox").each(function(){ 
		              $(this).attr("checked", true);  
		        });
		        layer.msg('拼命执行中，请稍等……', {icon: 16}, function(){
		        	layer.closeAll();
		        	layer.load(2);
		        	//发送异步请求，获取数据
		            sendRequest(pageContextPath + "/planLog/selectIds.do", null, function (jsonData) {
		                selectedIds = jsonData.ids;
		                layer.closeAll();
		            });
		        });
		    } else {   
		        $("input[name='choice']:checkbox").each(function() {   
		              $(this).attr("checked", false);  
		        });
		        selectedIds="";
		    }  
		}); */
	</script>
	<script
		src="${pageContext.request.contextPath}/javascript/httpService.js"></script>
	<style type="text/css">
.Textwrap {
	width: 150px;
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
}
</style>
</body>
</html>